package fr.cephb.joperon.core.entities;
import com.sleepycat.db.DatabaseEntry;
import com.sleepycat.db.DatabaseException;

import fr.cephb.joperon.core.bio.Chromosome;
import fr.cephb.joperon.core.entities.base.BaseGBuild;


/**
 * GBuild
 * Description: Genome build
 */
public class GBuild
	extends BaseGBuild
	{
	/**
     *
     * Constructor
     *
     */
	public GBuild()
		{
		super();
		}


        /**
         *
         * Copy Constructor
         *
         */
		public GBuild(BaseGBuild cp)
			{
			super(cp);
			}
		
		/**
		 * constructor from a database entry
		 *
		 */
		public GBuild(DatabaseEntry entry) throws DatabaseException
			{
			super(entry);
			}
		
		
        /**
         *
         * clone
         *
         */
		public Object clone()
			{
			return new GBuild(this);
			}
		
		/** answers a {@link fr.cephb.joperon.core.bio.Chromosome} object associated to this build or null if it cannot be found */
		public Chromosome getChromosome()
			{
			Chromosome c= Chromosome.getByName(getChr());
			if(c==null || c==Chromosome.ChrUndefined) return null;
			return c;
			}
		
		}

